#ifndef _LOGFILTERSIMPL_H_
#define _LOGFILTERSIMPL_H_

#include "stdafx.h"


struct WokerCb {
	UCHAR*		buf;
	ULONG		size;
	_QUEUE		node;
};

class CLogFiltersImpl :	public ILogFilters,
						public IPlugin,
						public IPluginRun,
						public CUnknownImp,
						public CTimeThread,
						public CThreadPool
					
{
public:
	CLogFiltersImpl(void);
	virtual ~CLogFiltersImpl(void);

public:
	BEGIN_STDCOM_MAP
		STDCOM_INTERFACE_ENTRY_UNKNOWN_(ILogFilters)
		STDCOM_INTERFACE_ENTRY(IPlugin)
		STDCOM_INTERFACE_ENTRY(IPluginRun)
		STDCOM_INTERFACE_ENTRY(ILogFilters)
	END_STDCOM_MAP

	//IPlugin
	std_method(Init)(int Argc, basic_tchar* Argv[], IBase* pRot, IBase* pBase);
	std_method(Uninit)();
	
	//IPluginRun
	std_method(Start)(_pinstance hInstance, UINT uType);
	std_method(Stop)(UINT uExitCode);

	//ILogs
	std_method(PostLog)(UCHAR* pBuf, ULONG Size);
public:
	std_method(SendPackage)(UCHAR* pBuf, ULONG Size);
	std_method(Time_Thread_Run)();
	std_method(ThreadPool_Run)(void* data, void* ctx);
	std_method(ThreadPool_Start)();
	std_method(ThreadPool_Stop)();
	std_method(ThreadPool_Error)();

public:
	_QUEUE wq;
	_QUEUE exit_message;

private:
	RotPtr						m_pRot;
	TaskList					m_ListJson;
	CAutoLock					m_lock;
	CSemHandle					m_sem;
	CCondHandle					m_cond;


};

#endif 

